<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="m" uri="mytaguri"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@page import="java.text.SimpleDateFormat"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'managerSuggestionList.jsp' starting page</title>
 		<script type="text/javascript">
	    function del(id){
	        if(window.confirm("确实要删除吗？")){
	        	location.href="deleteSuggestionById.action?id="+id;
	        }
    }

    </script>
  </head>
  
  <body bgcolor="#FAFBE7">
   <center>
   	<form action="">
  
   	<table border="1" bordercolor="#FFFFEF" width="600">
				<tr>
					
					<td style="border: 1px solid #009999">
						用户ID
					</td>
					<td style="border: 1px solid #009999">
						用户名称
					</td>
					<td style="border: 1px solid #009999">
						评论内容
					</td>
					<td style="border: 1px solid #009999">
						评论时间
					</td>
					<td style="border: 1px solid #009999">操作</td>
				</tr>
				<m:split pageSize="10" date="${requestScope.suggestionList}">
				<tr>
					<td style="border: 1px solid #009999">${dataRow.ofUserId}</td>
					<td style="border: 1px solid #009999">${dataRow.ofUserName}</td>
					<td style="border: 1px solid #009999">${dataRow.ofContent}</td>
					<td style="border: 1px solid #009999"><fmt:formatDate value="${dataRow.ofTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
					<td style="border: 1px solid #009999"> <a href="javascript:del(${dataRow.ofId});">删除</a></td>
				</tr>
				</m:split>
				<tr>
	   		<td colspan="9" style="border: 1px solid #009999" align="right">
	   			<a href='getAllSuggestion.action?currentPage=1'>首页</a>
				<a href='getAllSuggestion.action?currentPage=${ currentPage-1 }'>上一页</a>
				<a href='getAllSuggestion.action?currentPage=${ currentPage+1 }'>下一页</a>
				<a href='getAllSuggestion.action?currentPage=${ totalPage }'>尾页</a>
				${ currentPage }/${ totalPage }页
	   		</td>
			
			</table>
   	</form>
   
   </center>
  </body>
</html>
